package com.basedefence.models;

import java.util.ArrayList;

import org.andengine.entity.IEntity;
import org.andengine.entity.modifier.IEntityModifier;

public class GamePool implements IEntityModifier{
	private static ArrayList<IGameObject> poleArr = null;
	public static boolean addGameObject(IGameObject _object)
	{
		if(poleArr == null)
			poleArr = new ArrayList<IGameObject>();
		if(poleArr.contains(_object))
			return false;
		poleArr.add(_object);
		return true;
	}
	@Override
	public float onUpdate(float pSecondsElapsed, IEntity pItem) {
		if(poleArr == null)
			return -1;
		for(int i = 0; i < poleArr.size(); i++)
			poleArr.get(i).doUpdate((long)pSecondsElapsed);
		return 0;
	}

	@Override
	public IEntityModifier deepCopy()
			throws org.andengine.util.modifier.IModifier.DeepCopyNotSupportedException {
		return null;
	}
	@Override
	public void reset() {
	}
	@Override
	public boolean isFinished() {
		return false;
	}
	@Override
	public boolean isAutoUnregisterWhenFinished() {
		return false;
	}
	@Override
	public void setAutoUnregisterWhenFinished(boolean pRemoveWhenFinished) {
	}
	@Override
	public float getSecondsElapsed() {
		return 0;
	}
	@Override
	public float getDuration() {
		return 0;
	}
	@Override
	public void addModifierListener(
			org.andengine.util.modifier.IModifier.IModifierListener<IEntity> pModifierListener) {
	}
	@Override
	public boolean removeModifierListener(
			org.andengine.util.modifier.IModifier.IModifierListener<IEntity> pModifierListener) {
		return false;
	}
	
}
